/*
 * PlaylistInsertAction.java
 *
 * Created on April 8, 2006, 1:28 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package com.bff.slimserver.musicjukebox.lib.actions;

import com.bff.slimserver.musicjukebox.ui.ArtistDialog;
import com.bff.bjj.utils.Resources;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JFrame;
import org.bff.slimserver.musicobjects.SlimArtist;

/**
 *
 * @author Bill
 */
public class ViewArtistAction extends AbstractAction {

    private SlimArtist artist;
    private JFrame parent;

    /** Creates a new instance of PlaylistInsertAction */
    public ViewArtistAction(JFrame parent, SlimArtist artist) {
        this.artist = artist;
        this.parent = parent;
        putValue(Action.NAME,
                Resources.getMessage(Resources.LABEL_KEY.ACTION_VIEW_ARTIST_NAME));
        putValue(Action.SHORT_DESCRIPTION,
                Resources.getMessage(Resources.LABEL_KEY.ACTION_VIEW_ARTIST_SHORT_DESC));
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        ArtistDialog artistDialog = new ArtistDialog(parent, getArtist());
        artistDialog.setVisible(true);
    }

    /**
     * @return the artist
     */
    public SlimArtist getArtist() {
        return artist;
    }

    /**
     * @param artist the artist to set
     */
    public void setArtist(SlimArtist artist) {
        this.artist = artist;
    }
}
